import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import BaseLayout from '../components/BaseLayout.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: BaseLayout,
      redirect: '/list',
      children: [
        {
          path: '/list',
          name: 'list',
          component: () => import('../views/main/index.vue'), // 考试列表
        },
        {
          path: '/tips',
          name: 'tips',
          component: () => import('../views/exam/index.vue'), // 考试须知
        },
        {
          path: '/test-paper',
          name: 'test-paper',
          component: () => import('../views/exam/text-paper.vue'), // 主考试页
        },
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/login.vue') // 登录页
    },
  ]
})

export default router
